import 'package:flutter/material.dart';
import 'general_calculator_screen.dart';
import 'interest_rate_calculator_screen.dart';
import 'house_rent_sale_ratio_screen.dart';
import 'lottery_screen.dart';

class CalculatorScreen extends StatelessWidget {
  const CalculatorScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('计算器'),
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
      ),
      body: ListView(
        padding: const EdgeInsets.all(8.0),
        children: <Widget>[
          Card(
            child: ListTile(
              leading: const Icon(Icons.show_chart),
              title: const Text('利率计算器'),
              subtitle: const Text('计算存款、贷款利息'),
              trailing: const Icon(Icons.arrow_forward_ios),
              onTap: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => const InterestRateCalculatorScreen(),
                  ),
                );
              },
            ),
          ),
          Card(
            child: ListTile(
              leading: const Icon(Icons.calculate),
              title: const Text('速查计算器'),
              subtitle: const Text('常用计算'),
              trailing: const Icon(Icons.arrow_forward_ios),
              onTap: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => GeneralCalculatorScreen(),
                  ),
                );
              },
            ),
          ),
          Card(
            child: ListTile(
              leading: const Icon(Icons.home_work),
              title: const Text('房屋租售比计算'),
              subtitle: const Text('通过房租和租售比计算房价或反算租售比'),
              trailing: const Icon(Icons.arrow_forward_ios),
              onTap: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => const HouseRentSaleRatioScreen(),
                  ),
                );
              },
            ),
          ),
          Card(
            child: ListTile(
              leading: const Icon(Icons.sports_basketball),
              title: const Text('双色球选号'),
              subtitle: const Text('双色球彩票选号工具'),
              trailing: const Icon(Icons.arrow_forward_ios),
              onTap: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => const LotteryScreen(),
                  ),
                );
              },
            ),
          )
        ],
      ),
    );
  }
}
